package com.shiku.im.push.service.hwpush.examples;

import com.shiku.im.push.service.PushServiceUtils;
import com.shiku.im.push.service.hwpush.messaging.HuaweiApp;
import com.shiku.im.push.service.hwpush.util.InitAppUtils;

/**
 * 华为透传推送
 * @version V1.0
 * @Description: TODO(todo)
 * @date 2020/4/13 17:20
 */
public abstract class SendHWMessage extends PushServiceUtils {
    protected static String appSecret = pushConfig.getHw_appSecret();
    protected static String appId = pushConfig.getHw_appId();
    protected static String tokenUrl = pushConfig.getHw_tokenUrl();
    protected static String apiUrl = pushConfig.getHw_apiUrl();
    protected static String iconUrl = pushConfig.getHw_iconUrl();
    /*private static String accessToken;
    private static long tokenExpiredTime;*/
    private static HuaweiApp app;

    protected static HuaweiApp getAPPInfo(){
        if(null == app){
            HuaweiApp appInfo = InitAppUtils.initializeApp(appId,appSecret,tokenUrl,apiUrl);
            app = appInfo;
        }
        return app;
    }
}
